package com.cf.studiomanage.service.impl;

import com.cf.studiomanage.entity.Assessment;
import com.cf.studiomanage.mapper.AssessmentMapper;
import com.cf.studiomanage.service.AssessmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AssessmentServiceImpl implements AssessmentService {

    @Autowired
    private AssessmentMapper mapper;

    @Override
    public boolean add(Assessment assessment) {
        return mapper.add(assessment) > 0;
    }

    @Override
    public List<Assessment> getByUser(Long userId) {
        return mapper.getByUser(userId);
    }

    @Override
    public List<Assessment> top10ByType(String type) {
        return mapper.top10ByType(type);
    }

    @Override
    public boolean deleteById(Long id) {
        return mapper.deleteById(id) > 0;
    }
}
